/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.EntityInventory;
import gatperdut.chato.model.Chato.Item.EntityInventorySlot;
import gatperdut.chato.model.Chato.Item.Item;
import gatperdut.chato.model.Chato.Item.ItemPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Entity Inventory</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.EntityInventoryImpl#getSlots <em>Slots</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.EntityInventoryImpl#getItems <em>Items</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class EntityInventoryImpl extends GenericInventoryImpl implements EntityInventory {
	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected EntityInventoryImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ItemPackage.Literals.ENTITY_INVENTORY;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<EntityInventorySlot> getSlots() {
        return (EList<EntityInventorySlot>)eDynamicGet(ItemPackage.ENTITY_INVENTORY__SLOTS, ItemPackage.Literals.ENTITY_INVENTORY__SLOTS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    public EList<Item> getItems() {
        return (EList<Item>)eDynamicGet(ItemPackage.ENTITY_INVENTORY__ITEMS, ItemPackage.Literals.ENTITY_INVENTORY__ITEMS, true, true);
    }

    /**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY__SLOTS:
                return ((InternalEList<?>)getSlots()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY__SLOTS:
                return getSlots();
            case ItemPackage.ENTITY_INVENTORY__ITEMS:
                return getItems();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY__SLOTS:
                getSlots().clear();
                getSlots().addAll((Collection<? extends EntityInventorySlot>)newValue);
                return;
            case ItemPackage.ENTITY_INVENTORY__ITEMS:
                getItems().clear();
                getItems().addAll((Collection<? extends Item>)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY__SLOTS:
                getSlots().clear();
                return;
            case ItemPackage.ENTITY_INVENTORY__ITEMS:
                getItems().clear();
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY__SLOTS:
                return !getSlots().isEmpty();
            case ItemPackage.ENTITY_INVENTORY__ITEMS:
                return !getItems().isEmpty();
        }
        return super.eIsSet(featureID);
    }

} //EntityInventoryImpl
